package com.sxhuayuan.parking.aspects;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import com.sxhuayuan.parking.controller.open.ApiResp;

/**
 * 下单切面，如果是无感，则添加无感代扣队列
 * 
 * @author DELL
 *
 */
@Component("apiLoggerAspect")
@Aspect
public class ApiLoggerAspect {

	Logger log = LoggerFactory.getLogger(getClass());

	@Pointcut(value = "execution(* com.sxhuayuan.parking.controller.open.ApiController.gateway(..))")
	public void apiGatewayPointCut() {
	}

	@Before(value = "apiGatewayPointCut()")
	public void afterApiGateway(JoinPoint jp) throws Throwable {
	}

	@AfterReturning(value = "apiGatewayPointCut()", returning = "apiResp")
	public void afterApiGateway(JoinPoint jp, ApiResp apiResp) throws Throwable {
		log.debug("response: {}", apiResp);
	}
}